#include"udp_server.hpp"
#include<memory>
#include<cstring>

using namespace ns_server;
using namespace std;

static void usage(char proc[])
{
    std::cout << "Usage:\n\t" << proc << " port\n"<< std::endl;
}

int main(int argc,char *argv[])
{
    if(argc!=2)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }

    uint16_t port=atoi(argv[1]);
    unique_ptr<UdpServer>usvr(new UdpServer(port));
    usvr->InitServer();//初始化服务器
    usvr->Start();//启动服务器

    
    return 0;
}